/**
 * @file:          TrajectoryStepGenerator.h
 * @brief:         
 * @details:       
 * @author:        wjh
 * @date created:  2023.11.01
 * @version:       1.0.0
 * @par copyright (c):
 *   
 * @par history (desc):
 *   version:1.0.0, wjh, 2023.11.01,17:52:07
 */


#ifndef _TRAJECTORYSTEPGENERATOR_H_
#define _TRAJECTORYSTEPGENERATOR_H_

/* Include Files **************************************************************/
#include "Datatype.h"

/* Macro Definition ***********************************************************/

/* Data Type Define ***********************************************************/
typedef struct TrajectoryStepGenerator
{
    /* public data */
    float param_max_speed;
    float param_max_acc;
    float param_max_jerk;


    float in_pos_origin;
    float in_pos_target;

    uint32 out_step;

    uint16 mode;
    float displacement;
    float v[3];
    float t[4];
    float T[3];
    float s[3];
    
    /* private data */
    
    /* public method */
    void (*Init)(struct TrajectoryStepGenerator *self);
    float (*Run)(struct TrajectoryStepGenerator *self);
    float (*GenerateTrajectory)(struct TrajectoryStepGenerator *self);
    float (*GenerateStep)(struct TrajectoryStepGenerator *self);
    
    /* private method */
    
}TrajectoryStepGenerator;
    
/* Variable Declare ***********************************************************/

/* Function Declare ***********************************************************/
void TrajectoryStepGenerator_Init(struct TrajectoryStepGenerator *self);
float TrajectoryStepGenerator_Run(struct TrajectoryStepGenerator *self);
float TrajectoryStepGenerator_GenerateTrajectory(struct TrajectoryStepGenerator *self);
float TrajectoryStepGenerator_GenerateStep(struct TrajectoryStepGenerator *self);


#endif